package com.mp.approvalreq.dao;

import com.mp.approvalreq.entity.Overtime;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @author xq
 */
public interface OvertimeDao {

	/**
	 * 查询审批加班套件集合
	 *
	 * @param requestId
	 * @return
	 * @throws SQLException
	 */
	List<Overtime> selectOvertimesByRequestId(Integer requestId) throws SQLException;

	/**
	 * 批量插入加班套件信息
	 *
	 * @param overtimes
	 * @throws SQLException
	 */
	void insertBatchOvertimes(List<Overtime> overtimes) throws SQLException;

	/**
	 * 查询全公司指定时间范围的加班集合
	 *
	 * @param companyId
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws SQLException
	 */
	List<Overtime> selectCompanyOvertimesByDateScope(Integer companyId, String startTime, String endTime) throws SQLException;

	/**
	 * 批量查询用户指定时间范围的加班集合
	 *
	 * @param companyId
	 * @param companyInfoIds
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws SQLException
	 */
	List<Overtime> selectBatchUserOvertimesByDateScope(Integer companyId, String companyInfoIds, String startTime, String endTime) throws SQLException;

	/**
	 * 作废加班套件信息
	 *
	 * @param requestId
	 * @param companyId
	 * @throws SQLException
	 */
	void deleteOvertimeByRequestId(Integer requestId, Integer companyId) throws SQLException;

	/**
	 * 根据id批量查询加班集合
	 * @param requestIds
	 * @return
	 * @throws SQLException
	 */
	Map<Integer, List<Overtime>> selectOvertimesByRequestIds(String requestIds) throws SQLException;
}
